/*******************************************************************************
Replication Materials for Blau, Kahn, Brummund, Cook, and Larson-Koester "Is 
There Still Son Preference in the United States?"

Table AT4

Date Modified: 10/19/2019

*******************************************************************************/




*-------------------------------------------------------------------------------
                                   *LOAD DATA
*-------------------------------------------------------------------------------
use "$acs\acs_data",clear

*-------------------------------------------------------------------------------
                                 *RESTRICT SAMPLE
*-------------------------------------------------------------------------------
keep if nonusbirth == 0 & multi_sample != 1 & mult == 0 & oldc <=12 & ///
	inrange(age,18,40)==1 & nchild18>=1 & father_sample != 1 & female == 1
drop if citizen==1 | marst == 5

*-------------------------------------------------------------------------------
                                 *GENERATE VARS
*-------------------------------------------------------------------------------
gen inlf = empstat != 3

*-------------------------------------------------------------------------------
                           *REGRESSIONS, MARRIED WOMEN
*-------------------------------------------------------------------------------
label var chld1 "First Child Girl"
local wgt "perwtnorm"
local controls "lths scol cold sp_lths sp_scol sp_cold" //leave out: hsdi
local controls "`controls' i.genrace i.sp_genrace i.region i.year age age2 age3" 
local controls "`controls' sp_age sp_age2 sp_age3" 

// NATIVE
reg inlf chld1 `controls' if native == 1 & marst == 1 [aw=`wgt'], robust
sum inlf if native == 1 & marst == 1 [aw=`wgt']
local mean: display %5.4f  r(mean)
outreg2 using "$routput\Table_R13", replace excel dec(4) addtext(Dep. Var. Mean, `mean') keep(chld1) ctitle(Married, Native) label nocons nor2 ///
	title("Table A4: Effects of a Female First Child on the Probability of Being in the Labor Force: Married Women and All Women", "(Linear Probability Models), Extended Sample")

// IMMIGRANT
reg inlf chld1 `controls' if native == 0 & marst == 1 [aw=`wgt'], robust
sum inlf if native == 0 & marst == 1 [aw=`wgt']
local mean: display %5.4f  r(mean)
outreg2 using "$routput\Table_R13", append excel dec(4) addtext(Dep. Var. Mean, `mean') keep(chld1) ctitle(Married, Immigrant) label nocons nor2


// BOTH
reg inlf chld1 `controls' if marst == 1 [aw=`wgt'], robust
sum inlf if  marst == 1 [aw=`wgt']
local mean: display %5.4f  r(mean)
outreg2 using "$routput\Table_R13", append excel dec(4) addtext(Dep. Var. Mean, `mean') keep(chld1) ctitle(Married, Both) label nocons nor2		

*-------------------------------------------------------------------------------
                              *REGRESSIONS, ALL WOMEN
*-------------------------------------------------------------------------------
local wgt "perwtnorm"
local controls "lths scol cold" //leave out: hsdi
local controls "`controls' i.genrace i.region i.year age age2 age3"

// NATIVE
reg inlf chld1 `controls' if native == 1 [aw=`wgt'], robust
sum inlf if native == 1 [aw=`wgt']
local mean: display %5.4f  r(mean)
outreg2 using "$routput\Table_R13", append excel dec(4) addtext(Dep. Var. Mean, `mean') keep(chld1) ctitle(All, Native) label nocons nor2 

// IMMIGRANT
reg inlf chld1 `controls' if native == 0 [aw=`wgt'], robust
sum inlf if native == 0 [aw=`wgt']
local mean: display %5.4f  r(mean)
outreg2 using "$routput\Table_R13", append excel dec(4) addtext(Dep. Var. Mean, `mean') keep(chld1) ctitle(All, Immigrant) label nocons nor2

// BOTH
reg inlf chld1 `controls' [aw=`wgt'], robust
sum inlf  [aw=`wgt']
local mean: display %5.4f  r(mean)
outreg2 using "$routput\Table_R13", append excel dec(4) addtext(Dep. Var. Mean, `mean') keep(chld1) ctitle(All, Both) label nocons nor2